﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Share/Index.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">

 <% 
    string v = (Request["v"] == null ? "0" : Request["v"].ToString());
%>
<script language="javascript" type="text/javascript">
    $(function () {
        $("input[value=<%=v %>]").attr("checked", "true");
        $("input[name=g]").click(function () {
            window.location.href = "/report/userreport.html?v=" + $(this).val();
        });

    })
</script>

<div style="margin-top:20px;"><input type="radio" name="g" value="0" checked />学员/会员<input type="radio" name="g" value="1"  />会员状态<input type="radio" name="g" value="2"  />按学员状态<input type="radio" name="g" value="3"  />按嘉沃级别(前四位为统计标示) </div>
   <table  id="mainTable" cellspacing="0">
   <caption>会员统计</caption>
           <tr>
            <th>
                分类名称
            </th>
            <th>总人数</th>
            <th>借阅次数</th>
            <th>借阅图书数量</th>
           </tr>
        <tbody name="mainlist">
        <%
            BIZ.ReportOper ro = new BIZ.ReportOper();
            IList li = ro.getUserReport(v);

            int zrs = 0;
            int jycs = 0;
            int jytssl = 0;
            foreach (Hashtable tb in li)
            {
                zrs += int.Parse(tb["zrs"].ToString());
                jycs += int.Parse(tb["jycs"].ToString());
                jytssl += int.Parse(tb["jytssl"].ToString());
        %>
        <tr>
        <% 
                if(v=="3")
                {
                    Response.Write("<td>" + tb["jwcalss"].ToString() + "</td>");
                }
                else if (v == "2")
                {
                    Response.Write("<td>" + Enum.GetName(typeof(DAL.Enums.userState), int.Parse(tb["u_state"].ToString())) + "</td>");
                }
                else if (v == "1")
                {
                    Response.Write("<td>" + Enum.GetName(typeof(DAL.Enums.uservip), int.Parse(tb["u_vip"].ToString())) + "</td>");
                }
                else
                {
                    Response.Write("<td>" + Enum.GetName(typeof(DAL.Enums.userState), int.Parse(tb["u_state"].ToString())) + "," + Enum.GetName(typeof(DAL.Enums.uservip), int.Parse(tb["u_vip"].ToString())) + "</td>");
                }
            
        %>
        <td><%=tb["zrs"]%></td>
        <td><%=tb["jycs"]%></td>
        <td><%=tb["jytssl"]%></td>
        </tr>
        <% 
            }    
        %>
        <tr><td colspan="5" style="height:20px;"></td></tr>
        <tr>
        <td>总计</td>
        <td><%=zrs%></td>
        <td><%=jycs%></td>
        <td><%=jytssl%></td>
        </tr>
        </tbody>
    </table>

</asp:Content>
